﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dunnice.BlogIndex.Entity
{
    public class BlogGroup
    {
        public BlogGroup(int id, string name)
        {
            this.Id = id;
            this.Name = name;
        }

        public string Name { get; set; }
        public int Id { get; set; }

        public override bool Equals(object obj)
        {
            BlogGroup bg = obj as BlogGroup;

            if (bg == null)
                return false;

            if (this != obj)
            {
                return (bg.Id == this.Id && bg.Name == this.Name);
            }

            return true;
        }

        public override int GetHashCode()
        {
            return this.Id;
        }
    }
}
